//738
class Solution {
    public int monotoneIncreasingDigits(int n) {
        char[] arr = ((new String()).valueOf(n)).toCharArray();
        int len = arr.length;
        if (len == 1) {
            return n;
        }
        int flag = len;
        int ret = 0;
        for (int i = len-1; i  0; i--) {
            if (arr[i]  arr[i-1]) {
                flag = i-1;
                while (i = 2 && arr[i-1] == arr[i-2]) {
                    flag = i-2;
                    i--;
                }
            }
        }
        System.out.println(flag = +flag);
        for (int i = 0; i  len; i++) {
            ret = 10; 
            if (i == flag) {
                ret += (arr[i]-'0')-1;
                ret = fun(len-1-i, ret);
                break;
            } 
            ret += arr[i]-'0';
        }
        return ret;
    }

    public int fun(int num, int ret) {
        for (int i = 0; i  num; i++) {
            ret = 10;
            ret += 9;
        }
        return ret;
    }
}
//2418
class Solution {
    public String[] sortPeople(String[] names, int[] heights) {
        int len = heights.length;
        Integer[] arr = new Integer[len];
        for (int i = 0; i  len; i++) {
            arr[i] = i;
        }
        Arrays.sort(arr, (x, y)-{
            return heights[y]-heights[x];
        });
        String[] ret = new String[len];
        for (int i = 0; i  len; i++) {
            ret[i] = names[arr[i]];
        }
        return ret;
    }
}
//674
class Solution {
    public int findLengthOfLCIS(int[] nums) {
        int len = nums.length;
        int max = 1;
        int num = 1;
        for (int i = 0; i  len-1; i++) {
            if (nums[i]  nums[i+1]) {
                num++;
                max = Math.max(max, num);
            } else {
                num = 1;
            }
        }
        return max;
    }
}